﻿Imports System.IO

Public Class FrmRegistrarFotografiaCliente

    Public fotografia As Byte() = {}

    Private Sub picAtras_Click(sender As Object, e As EventArgs) Handles picAtras.Click
        For Each ctr As Control In Me.Parent.Controls.OfType(Of FrmRegistrarCredencialesCliente)()
            ctr.Visible = True
        Next
        Me.Visible = False
    End Sub

    Private Sub FrmRegistrarFotografiaCliente_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        abrirArchivo.FileName = ""
        If Screen.PrimaryScreen.WorkingArea.Height < 900 Then
            Me.AutoScroll = True
        End If
    End Sub

    Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
        FrmTransparente.Close()
    End Sub

    Private Sub btnSiguiente_Click(sender As Object, e As EventArgs) Handles btnSiguiente.Click
        Dim entro As Boolean = False
        For Each x As Control In Me.Parent.Controls.OfType(Of FrmRegistrarContactoReferenciaCliente)()
            x.Visible = True
            entro = True
        Next

        If Not entro Then
            Dim frm As New FrmRegistrarContactoReferenciaCliente()
            frm.Dock = DockStyle.Fill
            Me.Parent.Controls.Add(frm)
        End If
        Me.Visible = False
    End Sub

    Private Sub btnBuscar_Click(sender As Object, e As EventArgs) Handles btnBuscar.Click
        abrirArchivo.ShowDialog()
        If abrirArchivo.FileName <> "" Then
            picFotografia.Load(abrirArchivo.FileName)
            fotografia = File.ReadAllBytes(Me.abrirArchivo.FileName)
        End If
    End Sub
End Class